<?php
/**
 * Created by PhpStorm.
 * User: lzy
 * Date: 2018/11/1
 * Time: 15:46
 */

namespace App\Weixin\Models;

use App\Base\Models\BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * 微信提现
 * Class WeixinUserModel
 * @package App\Weixin\Models
 */
class  UserBalanceLogModel extends BaseModel
{

    use SoftDeletes;
    /**
     * 表名
     * @var string
     */
    public $table = "user_balance_log";
    /**
     * 时间自动
     * @var bool
     */
    public $timestamps = true;
    /**
     * The name of the "created at" column.
     *
     * @var string
     */
    const CREATED_AT = 'create_time';  //修改添加时间字段
    /**
     * The name of the "updated at" column.
     *
     * @var string
     */
    const UPDATED_AT = 'update_time';
    /**
     * 删除
     */
    const DELETED_AT = 'delete_time';
    /**
     * 删除
     */
    // const DELETED_AT = 'delete_time';
    /**
     * 模型的日期字段保存格式。
     */
    protected $dateFormat = 'U';

//    /**
//     * 自动添充值属性
//     * @var array
//     */
//    protected $attributes = [
//        'uid' => AUID,
//    ];

    /**
     * 操作名称
     * @param $type
     * @return string
     */
   public function getTypeName($type){
       $typeName='无标题';
       switch ($type){
           case 1:
               $typeName='提现扣减';
               break;
           case 2:
               $typeName='提现退款';
               break;
           case 3:
               $typeName='红包收入';
               break;
           case 4:
               $typeName='直推收入';
               break;
           case 5:
               $typeName='间推收入';
               break;
           case 6:
               $typeName='订单退款';
               break;
           case 7:
               $typeName='订单赏金';
               break;
           case 8:
               $typeName='投诉退款';
               break;
           case 9:
               $typeName='投诉补偿';
               break;


       }

       return $typeName;
   }
}